/*
 *  Acronym                : RapPIV.h
 *  Name of Module         : Rhapsody Libraries & DLLs
 *  Product/Project        : Rhapsody 2.0
 *  12NC                   :
 *  Group number           : 885540
 *  Creation date          : 2000-04-14
 *  Modification date      : 2002-10-18
 *  Related documents      : CTB554-98-B155
 *  Program language       : C
 *  Documentation language : English
 *  Status                 : Preliminary
 *  Author(s)              : P.J. Zander
 *                           J.F.J. Hendriks
 *
 *            Copyright (C) Philips Electronics N.V. 1999 - 2001
 *                  CFT Centre for Manufacturing Technology
 *                        Eindhoven - The Netherlands
 *
 *       All rights are reserved. Reproduction in whole or in part is
 *           prohibited without the written consent of the author.
 */

/*
 *  Description:
 *    Import header for the Rhapsody PIV functions
 *
 */

#ifndef _RAPPIV_H
#define _RAPPIV_H

/*
 *----------------------------------------------------------------------------
 *  Module Includes
 *----------------------------------------------------------------------------
 */

#include <Rhapsody.h>
#include <RapError.h>

/*
 *----------------------------------------------------------------------------
 * C++ Define
 *----------------------------------------------------------------------------
 */

#ifdef __cplusplus
extern "C" {
#endif

/*
 *----------------------------------------------------------------------------
 * Debug Defines
 *----------------------------------------------------------------------------
 */

#define RAP_DEBUG_OFF                           (0x0000)
#define RAP_DEBUG_GET                           (0xFFFF)
#define RAP_DEBUG_ALL                           (0x00FF)
#define RAP_DEBUG_EXPORTED_CALL                 (0x0001)
#define RAP_DEBUG_EXPORTED_INTERNAL             (0x0002)
#define RAP_DEBUG_FUNCTION_CALL                 (0x0004)
#define RAP_DEBUG_FUNCTION_INTERNAL             (0x0008)
#define RAP_DEBUG_ISR                           (0x0010)
#define RAP_DEBUG_API_CALL                      (0x0080)


/*
 *----------------------------------------------------------------------------
 * TriMedia DP Defines
 *----------------------------------------------------------------------------
 */
#ifdef BUILD_TRIMEDIA_BOARD

    extern unsigned char* TrmDpInit(
            unsigned int size);
    #define DP_INIT(size)   TrmDpInit(size)

#endif  /* BUILD_TRIMEDIA_BOARD */


/*
 *----------------------------------------------------------------------------
 * Trace Flags
 *----------------------------------------------------------------------------
 */
#define RAP_TRACE_ALL                   (0xFFFFFFFF)

#define RAP_TRACE_ALGORITHM_ALL         (0x000000FF)
#define RAP_TRACE_ALGORITHM_ARITHMIC    (0x00000001)
#define RAP_TRACE_ALGORITHM_STATISTIC   (0x00000002)
#define RAP_TRACE_ALGORITHM_FILTER      (0x00000004)
#define RAP_TRACE_ALGORITHM_MEASURE     (0x00000008)
#define RAP_TRACE_ALGORITHM_CORRELATE   (0x00000010)
#define RAP_TRACE_ALGORITHM_GRAPHICS    (0x00000020)

#define RAP_TRACE_COMMON_ALL            (0x0000FF00)
#define RAP_TRACE_COMMON_FILE           (0x00000100)
#define RAP_TRACE_COMMON_IMAGE          (0x00000200)
#define RAP_TRACE_COMMON_GENERAL        (0x00000400)
#define RAP_TRACE_COMMON_PTIMER         (0x00000800)

#define RAP_TRACE_INTERFACE_ALL         (0x000F0000)
#define RAP_TRACE_INTERFACE_BUFFER      (0x00010000)
#define RAP_TRACE_INTERFACE_QUEUE       (0x00020000)
#define RAP_TRACE_INTERFACE_GENERAL     (0x00040000)

#define RAP_TRACE_CONTROL_ALL           (0x7FF00000)
#define RAP_TRACE_CONTROL_MISC          (0x00100000)
#define RAP_TRACE_CONTROL_ACQUISITION   (0x00200000)
#define RAP_TRACE_CONTROL_CROSSBAR      (0x00400000)
#define RAP_TRACE_CONTROL_DISPLAY       (0x00800000)
#define RAP_TRACE_CONTROL_TIMER         (0x01000000)
#define RAP_TRACE_CONTROL_PARALLEL_IO   (0x02000000)
#define RAP_TRACE_CONTROL_SERIAL_IO     (0x04000000)
#define RAP_TRACE_CONTROL_PWM           (0x08000000)
#define RAP_TRACE_CONTROL_RS422         (0x10000000)
#define RAP_TRACE_CONTROL_THERMAL       (0x20000000)

#define RAP_TRACE_DEVELOPER             (0x80000000)

/*
 *----------------------------------------------------------------------------
 * Camera Defines
 *----------------------------------------------------------------------------
 */

#define RAP_HITACHI_KPM2_CCIR                   (6)
#define RAP_HITACHI_KPM2_RS170                  (7)
#define RAP_JAI_CV_M10_RS170                    (11)
#define RAP_SONY_XC55                           (13)

/*
 *----------------------------------------------------------------------------
 * Parameter defines
 *----------------------------------------------------------------------------
 */

#define RAP_PAR_PARENT_POINTER                  (0xF001)
#define RAP_PAR_FIELD_ODD_EVEN                  (0xF002)
#define RAP_PAR_BOARD_ID                        (0xF003)
#define RAP_PAR_CAMERA                          (0xF004)
#define RAP_PAR_MODIFIED                        (0xF005)
#define RAP_PAR_OFFSET_ROW                      (0xF006)
#define RAP_PAR_OFFSET_COL                      (0xF007)
#define RAP_PAR_NO_VIDEO_MODE                   (0xF008)
#define RAP_PAR_TARGET_IMAGE                    (0xF009)
#define RAP_PAR_PIXEL_SIZE                      (0xF00A)
#define RAP_PAR_CAM_DEFAULT_ROW                 (0xF00B)
#define RAP_PAR_CAM_DEFAULT_COL                 (0xF00C)

#define RAP_PAR_FACTORY_GAIN_CHANNEL_A          (0xF100)
#define RAP_PAR_FACTORY_GAIN_CHANNEL_B          (0xF101)
#define RAP_PAR_FACTORY_GAIN_CHANNEL_C          (0xF102)
#define RAP_PAR_FACTORY_GAIN_CHANNEL_D          (0xF103)
#define RAP_PAR_FACTORY_OFFSET_CHANNEL_A        (0xF104)
#define RAP_PAR_FACTORY_OFFSET_CHANNEL_B        (0xF105)
#define RAP_PAR_FACTORY_OFFSET_CHANNEL_C        (0xF106)
#define RAP_PAR_FACTORY_OFFSET_CHANNEL_D        (0xF107)
#define RAP_PAR_FACTORY_GAIN_COARSE_CHANNEL_A   (0xF108)
#define RAP_PAR_FACTORY_GAIN_COARSE_CHANNEL_B   (0xF109)
#define RAP_PAR_FACTORY_GAIN_COARSE_CHANNEL_C   (0xF10A)
#define RAP_PAR_FACTORY_GAIN_COARSE_CHANNEL_D   (0xF10B)
#define RAP_PAR_FACTORY_GAIN                    (0xF10C)
#define RAP_PAR_FACTORY_GAIN_COARSE             (0xF10D)
#define RAP_PAR_FACTORY_OFFSET                  (0xF10E)

#define RAP_PAR_THERMAL_HIGH_LIMIT              (0xF10F)
#define RAP_PAR_THERMAL_LOW_LIMIT               (0xF110)
#define RAP_PAR_THERMAL_TEMPERATURE             (0xF111)
#define RAP_PAR_THERMAL_SUSPEND_TIME            (0xF112)
#define RAP_PAR_THERMAL_RESUME_ALLOWED          (0xF113)

/* System parameter defines */
#define RAP_SYS_PAR_KEY_CHECK                   (0xE100)

/* Interface parameter defines */
#define RAP_INT_PAR_CONFIG_CALLBACK             (0xF200)


#define RAP_LED_SYS_MASK                        (0xF000)
#define RAP_LED_SYS_OFF                         (0x8000)
#define RAP_LED_SYS_RED                         (0x9000)
#define RAP_LED_SYS_YELLOW                      (0xA000)
#define RAP_LED_SYS_GREEN                       (0xC000)


/*
 *----------------------------------------------------------------------------
 * Subsystem ID's
 *----------------------------------------------------------------------------
 */

enum
{
    SUB_SYSTEM_RAP_START = 0,

    SUB_SYSTEM_ACC,                 //
    SUB_SYSTEM_ACI,                 //
    SUB_SYSTEM_ACO,                 //
    SUB_SYSTEM_ACP,                 //
    SUB_SYSTEM_ACQ,                 //
    SUB_SYSTEM_ARI,                 //
    SUB_SYSTEM_CAM,                 //
    SUB_SYSTEM_CAM_CL,              //
    SUB_SYSTEM_CAM_CV,              //
    SUB_SYSTEM_CAM_LA,              //
    SUB_SYSTEM_CAM_MVA,             //
    SUB_SYSTEM_CAM_PCS2112,         //
    SUB_SYSTEM_CBR,                 //
    SUB_SYSTEM_CHN,                 //
    SUB_SYSTEM_CON,                 // ConDebug not supported
    SUB_SYSTEM_COR,                 //
    SUB_SYSTEM_DIS,                 //
    SUB_SYSTEM_DPR,                 //
    SUB_SYSTEM_DSP,                 //
    SUB_SYSTEM_DVP,                 // DvpDebug not supported
    SUB_SYSTEM_FFS,                 // FfsDebug not supported
    SUB_SYSTEM_FIL,                 //
    SUB_SYSTEM_FLE,                 // FleDebug not supported
    SUB_SYSTEM_FNT,                 // FntDebug not supported
    SUB_SYSTEM_GEN,                 //
    SUB_SYSTEM_GRA,                 //
    SUB_SYSTEM_IMG,                 //
    SUB_SYSTEM_IMG_CHK,             // ImgChkDebug not supported
    SUB_SYSTEM_INF,                 //
    SUB_SYSTEM_INF_HW,              //
    SUB_SYSTEM_INF_CLIENT,          //
    SUB_SYSTEM_INF_SERVER,          //
    SUB_SYSTEM_INT,                 //
    SUB_SYSTEM_INT_BFR,             //
    SUB_SYSTEM_INT_CRT,             //
    SUB_SYSTEM_INT_MSG,             //
    SUB_SYSTEM_INT_TASK,            //
    SUB_SYSTEM_INT_LOCAL_BFR,       //
    SUB_SYSTEM_INT_LOCAL_MSG,       //
    SUB_SYSTEM_LCM,                 //
    SUB_SYSTEM_LED,                 //
    SUB_SYSTEM_LOG,                 //
    SUB_SYSTEM_MEA,                 //
    SUB_SYSTEM_MMX,                 // MmxDebug not supported
    SUB_SYSTEM_MSC,                 //
    SUB_SYSTEM_PIO,                 //
    SUB_SYSTEM_PTIMER,              //
    SUB_SYSTEM_PWM,                 //
    SUB_SYSTEM_RS422,               //
    SUB_SYSTEM_SIO,                 //
    SUB_SYSTEM_STA,                 //
    SUB_SYSTEM_STS,                 //
    SUB_SYSTEM_SYS,                 //
    SUB_SYSTEM_THERMAL,             //
    SUB_SYSTEM_TMR,                 //

    SUB_SYSTEM_RAP_END,


    SUB_SYSTEM_TRM_START,

    SUB_SYSTEM_TRM_BSP_MP,          // BspMpDebug not supported
    SUB_SYSTEM_TRM_BSP_SP,          // BspSpDebug not supported
    SUB_SYSTEM_TRM_CLK,             // ClkDebug not supported
    SUB_SYSTEM_TRM_CLOCK,           // ClockDebug not supported
    SUB_SYSTEM_TRM_CT1,             //
    SUB_SYSTEM_TRM_CT1_CL,          //
    SUB_SYSTEM_TRM_CT1_CV,          //
    SUB_SYSTEM_TRM_CT1_LA,          //
    SUB_SYSTEM_TRM_CT1_MVA,         //
    SUB_SYSTEM_TRM_CT2,             //
    SUB_SYSTEM_TRM_CT2_PCS2112,     //
    SUB_SYSTEM_TRM_DAC,             //
    SUB_SYSTEM_TRM_DIO,             //
    SUB_SYSTEM_TRM_DIS,             //
    SUB_SYSTEM_TRM_DIS_ENC,         //
    SUB_SYSTEM_TRM_DIS_SNC,         //
    SUB_SYSTEM_TRM_DMA,             // DmaDebug not supported
    SUB_SYSTEM_TRM_DMS,             //
    SUB_SYSTEM_TRM_DP,              // DpDebug  not supported
    SUB_SYSTEM_TRM_DPR,             //
    SUB_SYSTEM_TRM_EEP,             //
    SUB_SYSTEM_TRM_FBI,             //
    SUB_SYSTEM_TRM_FBO,             //
    SUB_SYSTEM_TRM_FCS,             //
    SUB_SYSTEM_TRM_FFD,             //
    SUB_SYSTEM_TRM_FMEM,            //
    SUB_SYSTEM_TRM_I2C,             //
    SUB_SYSTEM_TRM_IIC,             // IicDebug not supported
    SUB_SYSTEM_TRM_IOX,             //
    SUB_SYSTEM_TRM_IRQ,             // IrqDebug not supported
    SUB_SYSTEM_TRM_JTAG,            // JtagDebug not supported
    SUB_SYSTEM_TRM_L1_FFD,          // L1FfdDebug not supported
    SUB_SYSTEM_TRM_L1_XIO,          // L1XioDebug not supported
    SUB_SYSTEM_TRM_MMIO,            // MmioDebug not supported
    SUB_SYSTEM_TRM_MSC,             //
    SUB_SYSTEM_TRM_OS1,             // Os1Debug not supported
    SUB_SYSTEM_TRM_PCS2112,         //
    SUB_SYSTEM_TRM_PLG,             //
    SUB_SYSTEM_TRM_PROGRAM,         // ProgramDebug not supported
    SUB_SYSTEM_TRM_PSS,             // PssDebug not supported
    SUB_SYSTEM_TRM_PWM,             //
    SUB_SYSTEM_TRM_RS422,           //
    SUB_SYSTEM_TRM_SSI,             // SsiDebug not supported
    SUB_SYSTEM_TRM_THERMAL,         //
    SUB_SYSTEM_TRM_TIMER,           //
    SUB_SYSTEM_TRM_V24,             //
    SUB_SYSTEM_TRM_V24DEV,          //
    SUB_SYSTEM_TRM_V34,             //
    SUB_SYSTEM_TRM_VI,              // ViDebug not supported
    SUB_SYSTEM_TRM_VO,              // VoDebug not supported
    SUB_SYSTEM_TRM_WDT,             //
    SUB_SYSTEM_TRM_XBR,             //
    SUB_SYSTEM_TRM_XIO,             //

    SUB_SYSTEM_TRM_END

};


/*
 *----------------------------------------------------------------------------
 * Function ID's
 *----------------------------------------------------------------------------
 */

#define _RAP_DEVELOPER_FUNCTIONS        (0xF000)
#define _RAP_DEBUG_SET_MODE             (_RAP_DEVELOPER_FUNCTIONS + 0x00)
#define _RAP_FCS_READ                   (_RAP_DEVELOPER_FUNCTIONS + 0x01)
#define _RAP_FCS_WRITE                  (_RAP_DEVELOPER_FUNCTIONS + 0x02)
#define _RAP_I2C_READ                   (_RAP_DEVELOPER_FUNCTIONS + 0x03)
#define _RAP_I2C_WRITE                  (_RAP_DEVELOPER_FUNCTIONS + 0x04)
#define _RAP_V34_READ                   (_RAP_DEVELOPER_FUNCTIONS + 0x05)
#define _RAP_V34_WRITE                  (_RAP_DEVELOPER_FUNCTIONS + 0x06)
#define _RAP_EEP_READ                   (_RAP_DEVELOPER_FUNCTIONS + 0x07)
#define _RAP_EEP_WRITE                  (_RAP_DEVELOPER_FUNCTIONS + 0x08)
#define _RAP_IOX_READ                   (_RAP_DEVELOPER_FUNCTIONS + 0x09)
#define _RAP_IOX_WRITE                  (_RAP_DEVELOPER_FUNCTIONS + 0x0A)
#define _RAP_DAC_WRITE                  (_RAP_DEVELOPER_FUNCTIONS + 0x0B)
#define _RAP_FCS_TEST_MODE              (_RAP_DEVELOPER_FUNCTIONS + 0x0C)
#define _RAP_FCS_TEST_READ              (_RAP_DEVELOPER_FUNCTIONS + 0x0D)
#define _RAP_FCS_TEST_WRITE             (_RAP_DEVELOPER_FUNCTIONS + 0x0E)
#define _RAP_BOARD_TAG_READ             (_RAP_DEVELOPER_FUNCTIONS + 0x0F)
#define _RAP_BOARD_TAG_WRITE            (_RAP_DEVELOPER_FUNCTIONS + 0x10)
#define _RAP_CYCLES                     (_RAP_DEVELOPER_FUNCTIONS + 0x11)
#define _RAP_CM_TAG_READ                (_RAP_DEVELOPER_FUNCTIONS + 0x12)
#define _RAP_CM_TAG_WRITE               (_RAP_DEVELOPER_FUNCTIONS + 0x13)
#define _RAP_SIO_HWTEST                 (_RAP_DEVELOPER_FUNCTIONS + 0x14)
#define _RAP_SIO_HWTEST_EX              (_RAP_DEVELOPER_FUNCTIONS + 0x15)
#define _RAP_FCS_VIDEO_MODE             (_RAP_DEVELOPER_FUNCTIONS + 0x16)
#define _RAP_EEP_READ_BLOCK             (_RAP_DEVELOPER_FUNCTIONS + 0x17)
#define _RAP_EEP_WRITE_BLOCK            (_RAP_DEVELOPER_FUNCTIONS + 0x18)

#define _RAP_CAM_IMAGE_SIZE             (_RAP_DEVELOPER_FUNCTIONS + 0x20)
#define _RAP_IMG_GET_PARENT_LIST        (_RAP_DEVELOPER_FUNCTIONS + 0x21)
#define _RAP_MMX_FORCE_PRESENCE         (_RAP_DEVELOPER_FUNCTIONS + 0x22)
#define _RAP_CAPTURE_STOP_ALL           (_RAP_DEVELOPER_FUNCTIONS + 0x23)
#define _RAP_CONNECT_SOFTWARE           (_RAP_DEVELOPER_FUNCTIONS + 0x24)
#define _RAP_THERMAL_GET_PAR            (_RAP_DEVELOPER_FUNCTIONS + 0x25)
#define _RAP_THERMAL_SET_PAR            (_RAP_DEVELOPER_FUNCTIONS + 0x26)
#define _RAP_TARGET_GET_LIST            (_RAP_DEVELOPER_FUNCTIONS + 0x27)
#define _RAP_TRACE_SET_MODE             (_RAP_DEVELOPER_FUNCTIONS + 0x28)
#define _RAP_TRACE_GET_MODE             (_RAP_DEVELOPER_FUNCTIONS + 0x29)
#define _RAP_CONNECT                    (_RAP_DEVELOPER_FUNCTIONS + 0x2A)
#define _RAP_DISCONNECT                 (_RAP_DEVELOPER_FUNCTIONS + 0x2B)
#define _RAP_FFS_CONTENTS_DUMP          (_RAP_DEVELOPER_FUNCTIONS + 0x2C)
#define _RAP_FFS_FILE_COPY              (_RAP_DEVELOPER_FUNCTIONS + 0x2D)
#define _RAP_FFS_FILE_DELETE            (_RAP_DEVELOPER_FUNCTIONS + 0x2E)
#define _RAP_FFS_FILE_RENAME            (_RAP_DEVELOPER_FUNCTIONS + 0x2F)
#define _RAP_INT_CLAIM_LOAD             (_RAP_DEVELOPER_FUNCTIONS + 0x30)
#define _RAP_INT_STOP                   (_RAP_DEVELOPER_FUNCTIONS + 0x31)
#define _RAP_CONNECT_CLICKS             (_RAP_DEVELOPER_FUNCTIONS + 0x32)

#define _RAP_DPRAM_READ_BLOCK           (_RAP_DEVELOPER_FUNCTIONS + 0x40)
#define _RAP_DPRAM_READ_SYNCHRO         (_RAP_DEVELOPER_FUNCTIONS + 0x41)
#define _RAP_DPRAM_WRITE_BLOCK          (_RAP_DEVELOPER_FUNCTIONS + 0x42)
#define _RAP_DPRAM_WRITE_SYNCHRO        (_RAP_DEVELOPER_FUNCTIONS + 0x43)
#define _RAP_READ_SHARED_REGISTER       (_RAP_DEVELOPER_FUNCTIONS + 0x44)
#define _RAP_WRITE_SHARED_REGISTER      (_RAP_DEVELOPER_FUNCTIONS + 0x45)


/*
 *----------------------------------------------------------------------------
 *  Exported Function Prototypes
 *----------------------------------------------------------------------------
 */
/*
 *````````````````````````````````````````````````````````````````````````````
 *  RHAPSODY DLL
 *````````````````````````````````````````````````````````````````````````````
 */
    DLL_TYPE_RAP int RapTraceSetMode(
        unsigned long   traceMask,
        unsigned long   mode);

    DLL_TYPE_RAP int RapTraceGetMode(
        unsigned long   *traceModeOut);


/*
 *````````````````````````````````````````````````````````````````````````````
 *  INTERFACE component
 *````````````````````````````````````````````````````````````````````````````
 */

#ifndef RAP_TARGET_LIST_DEFINED
    #define RAP_TARGET_LIST_DEFINED
    typedef struct
    {
        int deviceId  [RAP_MAX_TARGETS];
        int deviceType[RAP_MAX_TARGETS];
    } RAP_TARGET_LIST;
#endif

#ifdef BUILD_TRIMEDIA_HOST
    DLL_TYPE_INF int  RapConnect(
        int     commonId);

    DLL_TYPE_INF int  RapDisconnect(
        int     commonId);
#endif

#ifdef BUILD_TRIMEDIA_BOARD
    DLL_TYPE_INF int  RapIntClaimLoad(
        void);

    DLL_TYPE_INF int  RapIntStop(
        void);
#endif


/*
 *````````````````````````````````````````````````````````````````````````````
 *  ALGORITHM component
 *````````````````````````````````````````````````````````````````````````````
 */

#ifndef FONTID_EX_DEFINED
    #define FONTID_EX_DEFINED
    typedef long FONTID_EX;
#endif

#ifdef BUILD_TRIMEDIA_BOARD
    DLL_TYPE_ALG int  RapDrawStringEx(
        OBJID           objectId,
        int             fromRow,
        int             fromCol,
        char           *stringIn,
        FONTID_EX       font,
        double          angle,
        IMAGE_OPERATION operation,
        long            drawColour,
        long            backGroundColour,
        int            *endColOut,
        IMAGE           imageSrcDst);
#endif  /* BUILD_TRIMEDIA_BOARD */

    DLL_TYPE_ALG int RapMmxForcePresence(
        int switchOn);


/*
 *````````````````````````````````````````````````````````````````````````````
 *  COMMON component
 *````````````````````````````````````````````````````````````````````````````
 */

    DLL_TYPE_COM int RapImgCreateEx(
        char       *bufferName,
        int         imageId,
        int         height,
        int         width,
        int         verticalPitch,
        int         pixelSize,
        void       *dataIn,
        IMAGE      *imageOut);

    DLL_TYPE_COM int  RapImgDownloadEx(
        IMAGE       image,
        char       *bufferName,
        int         verticalPitch);

    DLL_TYPE_COM int RapImgFreeEx(
        IMAGE               image,
        RAP_BUFFER_HANDLE   *imgBufferHndOut);

    DLL_TYPE_COM void RapImgGetParentList(
        void       *parentPointer,
        void       *nextParentListPointer,
        void       *ParentPointer);

    DLL_TYPE_COM int  RapImgUploadEx(
        IMAGE       image,
        char       *bufferName,
        int         verticalPitch);

/*
 *````````````````````````````````````````````````````````````````````````````
 * CONTROL component
 *````````````````````````````````````````````````````````````````````````````
 */

    DLL_TYPE_CTR int RapBoardTagRead(
        unsigned char   boardTagOut[10]);

    DLL_TYPE_CTR int RapBoardTagWrite(
        unsigned char   boardTagIn[10]);

    DLL_TYPE_CTR unsigned long RapCycles(
        void);

    DLL_TYPE_CTR int RapCamImageSize(
        int             boardId,
        int             captureField,
        int             videoRow,
        int             videoCol,
        int             videoHeight,
        int             videoWidth,
        int             videoSubRow,
        int             videoSubCol,
        int            *nPixelsPerLineOut,
        int            *nLinesPerImageOut);

    DLL_TYPE_CTR int RapCaptureStopAll(
        void);

    DLL_TYPE_CTR int RapDacWrite(
        int             id,
        int             port,
        int             value);

    DLL_TYPE_CTR int RapDebugSetMode(
        int             subSystem,
        int             debugMode);

    DLL_TYPE_CTR int RapEepRead(
        int             id,
        int             address,
        int            *valueOut);

    DLL_TYPE_CTR int RapEepReadBlock(
        int           id,
        int           address,
        int           size,
        unsigned char pData[]);

    DLL_TYPE_CTR int RapEepWrite(
        int             id,
        int             address,
        int             value);

    DLL_TYPE_CTR int RapEepWriteBlock(
        int           id,
        int           address,
        int           size,
        unsigned char pData[]);

    DLL_TYPE_CTR int RapFcsRead(
        int             id,
        int             address,
        int            *valueOut);

    DLL_TYPE_CTR int RapFcsTestMode(
        int             id,
        int             on,
        int             line);

    DLL_TYPE_CTR int RapFcsTestRead(
        int             id,
        int            *triggerOut);

    DLL_TYPE_CTR int RapFcsTestWrite(
        int             id,
        int             valid,
        int             flash,
        int             reset);

    DLL_TYPE_CTR int RapFcsVideoMode(
        int             id,
        int             on);

    DLL_TYPE_CTR int RapFcsWrite(
        int             id,
        int             address,
        int             value);

    DLL_TYPE_CTR int RapI2cRead(
        int             address,
        int             nBytes,
        int            *valueOut);

    DLL_TYPE_CTR int RapI2cWrite(
        int             address,
        int             nBytes,
        int             value);

    DLL_TYPE_CTR int RapIoxRead(
        int             id,
        int             pin,
        int            *valueOut);

    DLL_TYPE_CTR int RapIoxWrite(
        int             id,
        int             pin,
        int             value);

    DLL_TYPE_CTR int RapV34Read(
        int             address,
        int            *valueOut);

    DLL_TYPE_CTR int RapV34Write(
        int             address,
        int             value);

    #if ( (defined(BUILD_PRESTO_COMMON)) || \
          (defined(BUILD_LEGATO_BOARD))  || \
          (defined(BUILD_INCA_BOARD)) )

        DLL_TYPE_CTR int RapSioTestHardware(
            void);

        DLL_TYPE_CTR int RapSioTestHardwareEx(
            int     baudrate,
            int     databits,
            int     parityCheck,
            int     stopbits,
            int     flowcontrol,
            int     bufferSize);

    #endif  /* BUILD_PRESTO_COMMON || BUILD_LEGATO_BOARD */


    #ifdef BUILD_PRESTO_COMMON
        DLL_TYPE_CTR int RapCmTagRead(
            unsigned char   cmTagOut[10]);

        DLL_TYPE_CTR int RapCmTagWrite(
            unsigned char   cmTagIn[10]);
    #endif  /* BUILD_PRESTO_COMMON */

    #if ( (defined(BUILD_LEGATO_BOARD))  || \
          (defined(BUILD_INCA_BOARD)) )

        DLL_TYPE_CTR int RapFfsCheck(
            void);

    #endif

    #ifdef BUILD_LEGATO_BOARD
        DLL_TYPE_CTR int RapDpRamReadBlock(
            unsigned long   address,
            unsigned long   nBytes,
            unsigned char  *bytesOut);

        DLL_TYPE_CTR int RapDpRamReadSynchro(
            unsigned int   *synchroWordOut);

        DLL_TYPE_CTR int RapDpRamWriteBlock(
            unsigned long   address,
            unsigned long   nBytes,
            unsigned char  *bytesIn);

        DLL_TYPE_CTR int RapDpRamWriteSynchro(
            unsigned int    synchroWord);

        DLL_TYPE_CTR int RapReadSharedRegister(
            unsigned char  *vmeRegisterOut);

        DLL_TYPE_CTR int RapWriteSharedRegister(
            unsigned char   vmeRegister);
    #endif  /* BUILD_LEGATO_BOARD */


    #ifdef BUILD_INCA_BOARD

        DLL_TYPE_CTR int RapConnectClicks(
            unsigned long   swKey32In,
            unsigned long  *swKey32Out);

        DLL_TYPE_CTR int RapThermalGetPar(
            unsigned long   parameter,
            long           *valueOut);

        DLL_TYPE_CTR int RapThermalSetPar(
            unsigned long   parameter,
            long            value);

    #endif  /* BUILD_INCA_BOARD */

    DLL_TYPE_CTR int  RapTargetGetList(
        RAP_TARGET_LIST *targetListOut);


    DLL_TYPE_CTR int RapFfsContentsDump(
        const char    *iniFileNameIn);

    DLL_TYPE_CTR int RapFfsFileCopy(
        const char    *srcFileNameIn,
        const char    *dstFileNameIn);

    DLL_TYPE_CTR int RapFfsFileDelete(
        const char    *fileNameIn);

    DLL_TYPE_CTR int RapFfsFileRename(
        const char    *oldFileNameIn,
        const char    *newFileNameIn);


/*
 *````````````````````````````````````````````````````````````````````````````
 */

#ifdef __cplusplus
}
#endif

#endif // _RAPPIV_H
